#ifndef FACE_BEAUTY_INTERFACE_H
#define FACE_BEAUTY_INTERFACE_H

#include <cstddef>
#include <cstdint>
#include <memory>

#if defined(__clang__) || defined(__GNUC__)
    #define EXPORT
#elif defined(_MSC_VER)
    #define EXPORT __declspec(dllexport)
#endif

namespace facebeauty {

enum FACE_BEAUTY_FEATURE
{
    FACE_BEAUTY_FEATURE_WHITENING  = 0x00000001,
    FACE_BEAUTY_FEATURE_BUFFING    = 0x00000010,
    FACE_BEAUTY_FEATURE_BIGEYE     = 0x00000100,
    FACE_BEAUTY_FEATURE_THINFACE   = 0x00001000,
};

enum FACE_BEAUTY_COLOR_SPACE
{
    FACE_BEAUTY_COLOR_SPACE_YUV_I420_PLANAR = 0,
};

enum FACE_BEAUTY_ERROR
{
    FACE_BEAUTY_ERROR_SUCCESS = 0,
    FACE_BEAUTY_ERROR_FAILED  = -1,

    FACE_BEAUTY_ERROR_INVALID_ARG  = -1001,
};

struct EXPORT FaceBeautyFrame
{
    FaceBeautyFrame(): width_(0), height_(0), color_(0), data_{nullptr}, stride_{0}{};
    FaceBeautyFrame(uint16_t w, uint16_t h, uint16_t c): width_(w), height_(h), color_(c), data_{nullptr}, stride_{0}{};

    uint16_t width_;
    uint16_t height_;
    uint16_t color_;

    uint8_t* data_[3];
    uint32_t stride_[3];
};

class EXPORT FaceBeautyInterface
{
public:
    FaceBeautyInterface() {};
    virtual ~FaceBeautyInterface() {};

    virtual int InitModule(int feature, std::size_t width, std::size_t height, FACE_BEAUTY_COLOR_SPACE color) = 0;
    virtual void Reset() = 0;
    virtual int SetFeatureQuality(int feature, int quality) = 0;
    virtual int ProccessFrame(FaceBeautyFrame* in_frame, FaceBeautyFrame* out_frame = nullptr) = 0;

};

extern int EXPORT CreateFaceBeautyModule(std::shared_ptr<FaceBeautyInterface> &filter);

};

#endif //FACE_BEAUTY_INTERFACE_H
